import { post, get } from '@/http/index'

import { LoginRequest, reLoginRequest, LoginResponse, IUser } from '@/types/user'

/**
 * 用户登录
 * @param data 提交数据
 * @returns
 */
export const userLogin = async (data?: LoginRequest) => {
    return post<LoginResponse>({}, '/login', data)
}

/**
 * 重新登陆
 * @param data 提交数据
 * @returns
 */
export const refreshUserInfo = async (data?: reLoginRequest) => {
    return post<LoginResponse>({}, '/getUserInfo', data)
}

//  获取所有的用户
export function getUserList() {
    return get<IUser[]>({}, '/getUserList')
}
